import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as eleIcons from '@element-plus/icons-vue'

import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'

import '@/styles/index.scss'

const app = createApp(App)

app.use(ElementPlus)
app.use(router)
app.use(store)
// 全局安装icon
for (const iconName in eleIcons) {
  app.component(eleIcons[iconName].name, eleIcons[iconName])
}
// 全局挂载 https://v3.cn.vuejs.org/api/application-config.html#globalproperties
app.config.globalProperties.$dayjs = dayjs

app.mount('#app')
